package cn.sdormitory.smartdor.dao;

import cn.sdormitory.basedata.vo.BClassStudentVo;
import cn.sdormitory.smartdor.entity.SdLeave;
import cn.sdormitory.smartdor.vo.SdStudentLeaveVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @创建人：zhouyang
 * @创建时间：2021/11/15 15:21
 * @version：V1.0
 */
@Mapper
public interface SdStudentLeaveDao extends BaseMapper<SdStudentLeaveVo> {
    /**
     * 根据请假时间和学号查询学生请假信息
     * @param startDate
     * @param endDate
     * @param studentNo
     * @return
     */
    List<SdStudentLeaveVo> getStuLeaveByDateAndStuNo(@Param("studentNo") String studentNo,@Param("startDate") String startDate,@Param("endDate") String endDate) ;

    /**
     * 根据学号+请假时间修改学生请假信息
     * @param startDate
     * @param endDate
     * @param leaveId
     * @return
     */
    int updateStudentLeave(@Param("leaveId") Long leaveId,@Param("startDate") String startDate,@Param("endDate") String endDate);

    int updateStudentLeaveEnd(@Param("leaveId") Long leaveId,@Param("endDate") String endDate);

    int updateStudentEndLeave(@Param("leaveId") Long leaveId,@Param("endDate") String endDate);

    List<SdStudentLeaveVo> getStuLeaveByCName(@Param("className") String className);

    int getStuLeaveCount(Long leaveId);

    Integer deleteStuLeave(Long leaveId);

    int getStuLeaveCountById(Long leaveId,@Param("startDate") String startDate,@Param("endDate") String endDate);

    Integer deleteByStuNo(String studentNo);

    List<BClassStudentVo> getLeaveByClaNameAndStuName(@Param("className") String className, @Param("studentName") String studentName);

    Integer deleteByLeaAndAtt(@Param("studentNo") String studentNo,@Param("startDate") String startDate,@Param("endDate") String endDate);

    List<SdLeave> getStuLeavesList(@Param("vo")SdLeave vo);

    int updateStuLeaves(@Param("vo")SdLeave vo);

    Integer deleteByStuNoTime(@Param("studentNo")String studentNo,@Param("startDate") String startDate,@Param("endDate")String endDate);

    BClassStudentVo getStudentLeavenDetail(@Param("leaveId") Long leaveId);

}
